/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package chatModel;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.logging.Level;
import java.util.logging.Logger;

/* 
 * @author Vansh and deepali
 */
public class User {

    /**
     * @param username consists of a string representing the user name
     * @param hostname consists of the host name!!!
     * @param IPaddr consists of the IP address of the user
     */
    private String username;
    private String hostname;
    private InetAddress IPaddr;

    /**
     * This class represents the user and the information of this user
     */
    public User(String username, String hostname) {
        this.username = username;
        this.hostname = hostname;
        try {
            this.IPaddr = InetAddress.getByName("193.48.172.170");
        } catch (UnknownHostException ex) {
            Logger.getLogger(User.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    /**
     * This method allows us to get the user name
     */
    public String getUsername() {
        return username;
    }

    /**
     * This method allows us to get the host name
     */
    public String getHostname() {
        return hostname;
    }

    /**
     * This method allows us to get the IP address
     */
    public InetAddress getIPaddr() {
        return IPaddr;
    }

    @Override
    public String toString() {
        return username + "@" + hostname;
    }
}
